<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改交货路线')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-edit" th:object="${scrapping}">
        <!--<input id="rowkey" name="rowkey" type="hidden" th:field="*{rowkey}"/>-->
        <div class="form-group">
            <label class="col-sm-3 control-label ">主键：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" disabled name="rowkey" id="rowkey" th:field="*{rowkey}" required  >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">报废原因标识：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="rejectReason" id="rejectReason" th:field="*{rejectReason}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">报废原因描述：</label>
            <div class="col-sm-8">
                <input id="rejectMessage" name="rejectMessage" class="form-control" th:field="*{rejectMessage}" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">报废原因版本号：</label>
            <div class="col-sm-8">
                <input id="rowversion" disabled name="rowversion" class="form-control" th:field="*{rowversion}" type="text" required>
            </div>
        </div>

    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">
    
    function submitHandler() {
        if ($.validate.form()) {
            edit();
        }
    }

    function edit() {
        var rowkey = $("input[name='rowkey']").val();
        var rejectReason = $("input[name='rejectReason']").val();
        var rejectMessage = $("input[name='rejectMessage']").val();
        var rowversion = $("input[name='rejectMessage']").val();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "scrappingCauseTabs/edit",
            data : {
                "rowkey": rowkey,
                "rejectReason": rejectReason,
                "rejectMessage": rejectMessage,
                "rowversion": rowversion
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
    
    
</script>
</body>
</html>
